package com.like.scan;

import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;

import com.journeyapps.barcodescanner.BarcodeView;
import com.like.likeutils.device.DensityUtils;

public class CustomBarcodeView extends BarcodeView {
    public CustomBarcodeView(Context context) {
        super(context);
    }
    public CustomBarcodeView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public CustomBarcodeView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected Rect calculateFramingRect(Rect container, Rect surface) {
        Rect rect =  super.calculateFramingRect(container, surface);
        int offset = DensityUtils.dp2px(getContext(), 100);
        rect.offset(0, -offset);
        return rect;
    }
}
